/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.home.logic;

import com.home.dao.ScorecardTypeDao;
import com.home.mapping.ScorecardType;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

/**
 *
 * @author vi
 */
public class ScorecardTypeLogic {
    public List<ScorecardType> findAllScrorecardType() {
        List<ScorecardType> list = new ArrayList<ScorecardType>();
        list = new ScorecardTypeDao().findAll(ScorecardType.class);
        return list;
    }
    
    public ScorecardType findScorecardType(Integer idScorecardType) {
        return new ScorecardTypeDao().findScorecardType(idScorecardType);
    }
    
    public Map<Integer, ScorecardType> findMapAllScorecardType() {
        List<ScorecardType> list = new ScorecardTypeDao().findAll(ScorecardType.class);
        Map<Integer, ScorecardType> map = new TreeMap<>();
        for (ScorecardType st : list) {
            map.put(st.getIdScorecardType(), st);
        }
        return map;
    }
}
